﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BeerManagementSystem
{
    /// <summary>
    /// Interaktionslogik für Inviter.xaml
    /// </summary>
    public partial class Inviter : UserControl
    {
        String imagePath = AppDomain.CurrentDomain.BaseDirectory + "UserImages\\";       
        int j = 0;
        Canvas[] canvasArray = new Canvas[9];
        LinqToBeerDataContext _linq;
        public Inviter()
        {
            InitializeComponent();
            //LinkedList <Canvas> canvasVar = from c in inviterMainCanvas.Children
            //                orderby Canvas.ZIndexProperty
            //                select c;

            canvasArray[0] = canvas1;
            canvasArray[1] = canvas2;
            canvasArray[2] = canvas3;
            canvasArray[3] = canvas4;
            canvasArray[4] = canvas5;
            canvasArray[5] = canvas6;
            canvasArray[6] = canvas7;
            canvasArray[7] = canvas8;
            canvasArray[8] = canvas9;
            
        }


        public void addPicture(BitmapImage img)
        {
            canvasArray[j].BeginInit();
            System.Windows.Controls.Image image = new System.Windows.Controls.Image
            {
                Height = 160,
                Source = img
            };
            image.RenderSize = new System.Windows.Size(116, 160);
            canvasArray[j].Children.Add(image);            
            canvasArray[j].EndInit();
            
            j++;
        }
        public void clearMainCanvasInviter()
        {
            inviterMainCanvas.Children.Clear();
        }
    }
}
